# Author：liyimei
# Time：2023/5/15 15:30
from selenium import webdriver
import time

# 打开浏览器
driver = webdriver.Chrome()
# 输入网址
driver.get('http://www.baidu.com/')
driver.maximize_window()
# 添加和登录相关的cookie
cookies = [
    {'name': 'BDUSS',
     'value': 'kJTZ2Q1Vjk1dm5IQ0VqVkRGU08tTmk2MEowOWhydlViaEhublUxd041SjZmVXBrSVFBQUFBJCQAAAAAAAAAAAEAAAD6v7NTUXVlZW7Dzsyrye4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHrwImR68CJkU'},
    {'name': 'BDUSS_BFESS',
     'value': 'kJTZ2Q1Vjk1dm5IQ0VqVkRGU08tTmk2MEowOWhydlViaEhublUxd041SjZmVXBrSVFBQUFBJCQAAAAAAAAAAAEAAAD6v7NTUXVlZW7Dzsyrye4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHrwImR68CJkU'}
]
for cookie in cookies:
    driver.add_cookie(cookie)

# 刷新页面
driver.refresh()

# 关闭浏览器
time.sleep(50)
driver.quit()
